package com.tongji.seller.model
{ 
	import com.adobe.serialization.json.JSON;
	import com.tongji.seller.utils.PageTools;
	
	import mx.collections.ArrayCollection;
	import mx.controls.Image;
	
	import org.robotlegs.mvcs.Actor;
	
	/**
	 * 
	 * @author jiarong
	 * 
	 */
	[Bindable]
	public class SearchSceneModel extends Actor
	{
		public var scene:String;
		public var sceneArr:ArrayCollection;
		public var SearchSceneArr:ArrayCollection;
		
		public var cdIdStr:String;
		public var fgIdStr:String;
		
		/*------分页相关数据-------*/
		public var nums:ArrayCollection;
		public var pageArray:ArrayCollection;
		public var pageCount:Number;
		public var pageIndex:Number = 1;
		public var recordCount:Number;
			
		public function SearchSceneModel()
		{
			super();
		}
	
		public function updateScenes(scene:String):void
		{
			this.scene = scene;
			var arr:Array = (JSON.decode(scene) as Array);
			sceneArr = new ArrayCollection(arr);
			SearchSceneArr = new ArrayCollection(sceneArr[0].VR_SceneList);	
			recordCount = sceneArr[0].PageCount;
			
			var pageTools:PageTools = new PageTools(recordCount, 3, 9, pageIndex);
			nums = pageTools.nums;
			pageArray = pageTools.pageArray;
			pageCount = pageTools.pageCount;
			pageIndex = pageTools.pageIndex;
		}
	}
}